package mapred.example;

import java.io.IOException;

import mapred.CombineConfig;
import mapred.InputConfig;
import mapred.Job;
import mapred.MapConfig;
import mapred.OutputConfig;
import mapred.ReduceConfig;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.KeyValueTextInputFormat;
import org.apache.hadoop.mapred.RunningJob;
import org.apache.hadoop.mapred.TextOutputFormat;

public class Unzip extends Job {

	public Unzip(String... settings) {
		super("Unzip", settings);
	}

	@Override
	protected CombineConfig getCombineConfig() {
		return CombineConfig.newInstance(null);
	}

	@Override
	protected InputConfig getInputConfig(FileSystem fs) throws IOException {
		return InputConfig.newInstance(KeyValueTextInputFormat.class, "");
	}

	@Override
	protected MapConfig getMapConfig() {
		return MapConfig.newInstance(null, 0, Text.class, Text.class, null);
	}

	@Override
	protected OutputConfig getOutputConfig(FileSystem fs) throws IOException {
		return OutputConfig.newInstance(TextOutputFormat.class, Text.class, Text.class, "", null);
	}

	@Override
	protected ReduceConfig getReduceConfig() {
		return ReduceConfig.newInstance(null, 0);
	}

	@Override
	protected void setUp(JobConf conf, FileSystem fs) throws IOException {
	}

	@Override
	protected void tearDown(JobConf conf, FileSystem fs, RunningJob job)
			throws IOException {
	}

}
